//deque 大小操作
#include <iostream>
#include <deque>

using namespace std;

void printDeque1(deque<int> d)
{
    for(auto it=d.begin();it!=d.end();it++)
    {
        cout<<*it<<" ";
    }
    cout<<endl;
}

void printDeque2(deque<int> d)
{
    for(int i=0;i<d.size();i++)
    {
        cout<<d[i]<<" ";
    }
    cout<<endl;
}

int main()
{
    deque<int> d;
    cout<<"d.empty():"<<d.empty()<<endl;
    cout<<"d.size():"<<d.size()<<endl;

    d.assign({1,2,3});
    cout<<"d.empty():"<<d.empty()<<endl;
    cout<<"d.size():"<<d.size()<<endl;
    printDeque2(d);

    d.resize(18);
    cout<<"d.size();"<<d.size()<<endl;
    printDeque1(d);

    d.resize(20,6);//将大小调整为20,新增元素为6
    cout<<"d.size():"<<d.size()<<endl;
    printDeque1(d);

    d.resize(10000);
    d.resize(5);
    cout<<"d.size():"<<d.size()<<endl;
    printDeque1(d);

    return 0;
}